#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>

#define LED_ON _IO('L', 1)
#define LED_OFF _IO('L', 2)	 

	
int main()
{
	int fd;
	unsigned int led_status=1;
	fd = open("/dev/drv_led", O_RDWR);
	if(fd < 0)
	{
		printf("drv_led open err\r\n");
		exit(1);
	}
	write(fd, &led_status, sizeof(unsigned int));
	while(1)
	{
		ioctl(fd, LED_ON, 1);
		sleep(1);
		ioctl(fd, LED_OFF, 1);
		sleep(1);
	}
	close(fd);
}
